define(["jquery","bbcare"], function($,$bb){
	var defaults = {},store = {};
	var baseUrl = $bb.baseUrl("department");
	defaults.url = {
		patientReport	: baseUrl + "patient/patientStatisticsQuery",
		patientLine		: baseUrl + "servicemanager/patientTrendStatisics",
		newPatient		: baseUrl + "patient/patientQueueListQuery",
		seviceReport	: baseUrl + "servicemanager/useStatistics",
		seviceLine		: baseUrl + "servicemanager/patientTrendStatisics",
		serviceList		: baseUrl + "patient/activeInfo/list",
		missionLine		: baseUrl + "education/browseStatistics",
		missionList		: baseUrl + "education/list",
		monitorPie		: baseUrl + "patient/monitorDataStatistics",
		monitorLine		: baseUrl + "patient/monitorTimesStatistics",
		monitorList		: baseUrl + "patient/activeInfo/list"
	}
	
	/**
	 * 获取Ajax默认配置参数
	 */
	var getAjaxDefaultParams = function(data){
		return {
	        type: "post",
	        contentType: "application/json;charset=UTF-8",
	        dataType: "json",
	        data: JSON.stringify({
	            data: data?data:{}
	        }),
	        error: function (data) {
	            console.log('请求出错' + data);
	        }
		}
	}
	
	/**
	 * 科室患者统计信息查询
	 */
	store.patientReport = function(callback){
		var params = getAjaxDefaultParams();
		params.url = defaults.url.patientReport;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 患者活跃趋势查询
	 */
	store.patientLine = function(slot,callback){
		var params = getAjaxDefaultParams({"flag":slot});
		params.url = defaults.url.patientLine;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 新增患者查询
	 */
	store.newPatient = function(callback){
		var params = getAjaxDefaultParams({"rows":3});
		params.url = defaults.url.newPatient;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 科室服务统计
	 */
	store.serviceReport = function(callback){
		var params = getAjaxDefaultParams();
		params.url = defaults.url.seviceReport;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 服务趋势查询
	 */
	store.serviceLine = function(type,slot,callback){
		var params = getAjaxDefaultParams({"flag":slot,"type":type});
		params.url = defaults.url.seviceLine;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 获取服务动态记录
	 */
	store.serviceList = function(callback){
		var params = getAjaxDefaultParams({
            "rows":"5"
        });
		params.url = defaults.url.serviceList;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 宣教月度趋势查询
	 */
	store.missionLine = function(slot,callback){
		var params = getAjaxDefaultParams({"flag":slot});
		params.url = defaults.url.missionLine;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 获取宣教排行榜
	 */
	store.missionList = function(callback){
		var params = getAjaxDefaultParams();
		params.url = defaults.url.missionList;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 氧饱监测异常统计
	 */
	store.monitorPie = function(type,callback){
		var params = getAjaxDefaultParams({"type":type});
		params.url = defaults.url.monitorPie;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 氧饱监测量趋势
	 */
	store.monitorLine = function(slot,callback){
		var params = getAjaxDefaultParams({"flag":slot});
		params.url = defaults.url.monitorLine;
		params.success = callback
		$bb.ajax(params);
	}
	
	/**
	 * 获取监测记录
	 */
	store.monitorList = function(callback){
		var params = getAjaxDefaultParams({
            "busiCategory":"6",
            "rows":"10"
        });
		params.url = defaults.url.monitorList;
		params.success = callback
		$bb.ajax(params);
	}
	
	return store;
});
